# Maintainer: Gaetan Bisson <bisson@archlinux.org>
# Contributor: damir <damir@archlinux.org>
# Contributor: Gan Lu <rhythm.gan@gmail.com>

pkgname=scim
pkgver=1.4.18
pkgrel=3
pkgdesc='Input method user interface and development platform'
url='https://github.com/scim-im/scim'
license=('LGPL')
arch=('x86_64')
depends=('libltdl' 'gtk2')
optdepends=('gtk3: gtk3 immodule')
makedepends=('intltool' 'gtk3')
source=("$pkgname-$pkgver.tar.gz::https://github.com/scim-im/scim/archive/$pkgver.tar.gz")
sha512sums=('9a6090fc1ab950905a9c54d6678ce3d2a44297d1a992a3e933b0466688638e6cf470c1682daa58a6fbb6de3216b649273faf7edff1ac0ecca1c2c77fc19108fb')

backup=('etc/scim/config' 'etc/scim/global')
install=install

prepare() {
	cd "${srcdir}/${pkgname}-${pkgver}"
	./bootstrap
}

build() {
	cd "${srcdir}/${pkgname}-${pkgver}"
	./configure \
		--prefix=/usr \
		--sysconfdir=/etc \
		--with-gtk-version=2 # no gtk3 support in scim-anthy

	make
}

package() {
	cd "${srcdir}/${pkgname}-${pkgver}"
	make DESTDIR="${pkgdir}" install
}
